﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Reactive.Concurrency;
using System.Threading;
#if !WINDOWS_PHONE
using System.Threading.Tasks;
#endif

namespace System.Reactive.Linq
{
	public static partial class Observable
	{
		public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources)
		{
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Requires(sources != null, null, "sources != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource)
		{
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Requires(sources != null, null, "sources != null");
			Contract.Requires(defaultSource != null, null, "defaultSource != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler)
		{
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Requires(sources != null, null, "sources != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> Cast<TResult>(this IObservable<object> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TSource> Catch<TSource>(params IObservable<TSource>[] sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Catch<TSource>(this IEnumerable<IObservable<TSource>> sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Catch<TSource, TException>(this IObservable<TSource> source, Func<TException, IObservable<TSource>> handler)
			where TException : Exception
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(handler != null, null, "handler != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Catch<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
		{
			Contract.Requires(first != null, null, "first != null");
			Contract.Requires(second != null, null, "second != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IEnumerable<IList<TSource>> Chunkify<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IEnumerable<IList<TSource>>>() != null, null, "Contract.Result<IEnumerable<IList<TSource>>>() != null");
			return null;
		}

		public static IEnumerable<TResult> Collect<TSource, TResult>(this IObservable<TSource> source, Func<TResult> newCollector, Func<TResult, TSource, TResult> merge)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(newCollector != null, null, "newCollector != null");
			Contract.Requires(merge != null, null, "merge != null");
			Contract.Ensures(Contract.Result<IEnumerable<TResult>>() != null, null, "Contract.Result<IEnumerable<TResult>>() != null");
			return null;
		}

		public static IEnumerable<TResult> Collect<TSource, TResult>(this IObservable<TSource> source, Func<TResult> getInitialCollector, Func<TResult, TSource, TResult> merge, Func<TResult, TResult> getNewCollector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(getInitialCollector != null, null, "getInitialCollector != null");
			Contract.Requires(merge != null, null, "merge != null");
			Contract.Requires(getNewCollector != null, null, "getNewCollector != null");
			Contract.Ensures(Contract.Result<IEnumerable<TResult>>() != null, null, "Contract.Result<IEnumerable<TResult>>() != null");
			return null;
		}

		public static IObservable<IList<TSource>> CombineLatest<TSource>(params IObservable<TSource>[] sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<IList<TSource>>>() != null, null, "Contract.Result<IObservable<IList<TSource>>>() != null");
			return null;
		}

		public static IObservable<IList<TSource>> CombineLatest<TSource>(this IEnumerable<IObservable<TSource>> sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<IList<TSource>>>() != null, null, "Contract.Result<IObservable<IList<TSource>>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<TSource, TResult>(this IEnumerable<IObservable<TSource>> sources, Func<IList<TSource>, TResult> resultSelector)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<TFirst, TSecond, TResult>(this IObservable<TFirst> first, IObservable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
		{
			Contract.Requires(first != null, null, "first != null");
			Contract.Requires(second != null, null, "second != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, Func<T1, T2, T3, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, Func<T1, T2, T3, T4, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, Func<T1, T2, T3, T4, T5, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, Func<T1, T2, T3, T4, T5, T6, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, Func<T1, T2, T3, T4, T5, T6, T7, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(source12 != null, null, "source12 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, IObservable<T13> source13, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(source12 != null, null, "source12 != null");
			Contract.Requires(source13 != null, null, "source13 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, IObservable<T13> source13, IObservable<T14> source14, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(source12 != null, null, "source12 != null");
			Contract.Requires(source13 != null, null, "source13 != null");
			Contract.Requires(source14 != null, null, "source14 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, IObservable<T13> source13, IObservable<T14> source14, IObservable<T15> source15, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(source12 != null, null, "source12 != null");
			Contract.Requires(source13 != null, null, "source13 != null");
			Contract.Requires(source14 != null, null, "source14 != null");
			Contract.Requires(source15 != null, null, "source15 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CombineLatest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>(this IObservable<T1> source1, IObservable<T2> source2, IObservable<T3> source3, IObservable<T4> source4, IObservable<T5> source5, IObservable<T6> source6, IObservable<T7> source7, IObservable<T8> source8, IObservable<T9> source9, IObservable<T10> source10, IObservable<T11> source11, IObservable<T12> source12, IObservable<T13> source13, IObservable<T14> source14, IObservable<T15> source15, IObservable<T16> source16, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> resultSelector)
		{
			Contract.Requires(source1 != null, null, "source1 != null");
			Contract.Requires(source2 != null, null, "source2 != null");
			Contract.Requires(source3 != null, null, "source3 != null");
			Contract.Requires(source4 != null, null, "source4 != null");
			Contract.Requires(source5 != null, null, "source5 != null");
			Contract.Requires(source6 != null, null, "source6 != null");
			Contract.Requires(source7 != null, null, "source7 != null");
			Contract.Requires(source8 != null, null, "source8 != null");
			Contract.Requires(source9 != null, null, "source9 != null");
			Contract.Requires(source10 != null, null, "source10 != null");
			Contract.Requires(source11 != null, null, "source11 != null");
			Contract.Requires(source12 != null, null, "source12 != null");
			Contract.Requires(source13 != null, null, "source13 != null");
			Contract.Requires(source14 != null, null, "source14 != null");
			Contract.Requires(source15 != null, null, "source15 != null");
			Contract.Requires(source16 != null, null, "source16 != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}
#endif

		public static IObservable<TSource> Concat<TSource>(params IObservable<TSource>[] sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Concat<TSource>(this IEnumerable<IObservable<TSource>> sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Concat<TSource>(this IObservable<IObservable<TSource>> sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Concat<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
		{
			Contract.Requires(first != null, null, "first != null");
			Contract.Requires(second != null, null, "second != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<bool> Contains<TSource>(this IObservable<TSource> source, TSource value)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IObservable<bool>>() != null, null, "Contract.Result<IObservable<bool>>() != null");
			return null;
		}

		public static IObservable<bool> Contains<TSource>(this IObservable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(comparer != null, null, "comparer != null");
			Contract.Ensures(Contract.Result<IObservable<bool>>() != null, null, "Contract.Result<IObservable<bool>>() != null");
			return null;
		}

		public static IObservable<int> Count<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IObservable<int>>() != null, null, "Contract.Result<IObservable<int>>() != null");
			return null;
		}

		public static IObservable<Unit> Create(Func<IEnumerable<IObservable<object>>> iteratorMethod)
		{
			Contract.Requires(iteratorMethod != null, null, "iteratorMethod != null");
			Contract.Ensures(Contract.Result<IObservable<Unit>>() != null, null, "Contract.Result<IObservable<Unit>>() != null");
			return null;
		}

		public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, IEnumerable<IObservable<object>>> iteratorMethod)
		{
			Contract.Requires(iteratorMethod != null, null, "iteratorMethod != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, Action> subscribe)
		{
			Contract.Requires(subscribe != null, null, "subscribe != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, IDisposable> subscribe)
		{
			Contract.Requires(subscribe != null, null, "subscribe != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, Task<Action>> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, Task> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, Task<IDisposable>> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> CreateAsync<TResult>(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync)
		{
			Contract.Requires(subscribeAsync != null, null, "subscribeAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}
#endif
	}
}